import mongoose from '../dbHelper';
const Schema = mongoose.Schema;
const JianceOrderSchema = new Schema({
    owner_id: {
        type: Schema.Types.ObjectId,
        ref: 'AiUser',
    },
    shop_id: Number,
    batchId: Schema.Types.ObjectId,
    proxyId: {
        type: Schema.Types.ObjectId,
        ref: 'DlyAdminUser' // 代理商id
    }, // 代理商id
    status: { //0 已创建  //1 已完成 //2 已支付待完成 //-1 成功但扣款失败 //-2订单失败，已退积分 //-3订单失败，未支付
        type: Number,
        default: 0,
    },
    api_request_data: {
        type: Schema.Types.Mixed,
    },
    api_response_data: {
        type: Schema.Types.Mixed,
    },
    errorMessage: String,
    costTotal: Number,
    costScore: Number,
    costSendScore: Number,
}, {timestamps:true})

export default mongoose.model('JianceOrder', JianceOrderSchema, 'JianceOrder');